package com.net.protocol.model;

import java.util.List;

public class RecordFile extends BaseModel {
    //文件名
    public String name;
    //文件大小 M
    public int size;
    //开始时间 yyyy-MM-dd HH:mm:ss
    public String startTime;
    //结束时间
    public String endTime;
    public RecordFile(){}

    public RecordFile(int id,int seqId,int code,String name,int size,String startTime,String endTime){
        super(id,seqId,code);
        this.name = name;
        this.startTime = startTime;
        this.size = size;
        this.endTime = endTime;
    }

    //---------------以下字段用于UI,非必填------------//
    public boolean isSelected;
    //0 待播放 1 需要请求播放 2 正在播放 3 播放完成
    public int playState;
    //播放位置
    public int playPosition;
    //文件的标签
    public List<FileTag.Tag> tags;

    public String getPlayDesc(){
        String desc = "待播放";
        switch (playState){
            case 2:
                desc = "正在播放";
                break;
            case 3:
                desc = "播放万完成";
                break;
        }
        return desc;
    }

    public void clearTagSelected() {
        if (tags != null && tags.size() > 0){
            for (int i = 0; i < tags.size(); i++) {
                tags.get(i).selected =false;
            }
        }
    }
}
